package GUI.PrincipalGUI;

import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.JButton;
import javax.swing.border.TitledBorder;
import javax.swing.JTextField;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JRadioButton;
import javax.swing.SwingConstants;

import controllers.PrincipalController;

import GUI.MainGUI;

@SuppressWarnings("serial")
public class PrincipalReports extends JPanel  implements ActionListener{
	
	private JButton btnStudentReports;
	private JButton btnExamRepots;
	private JButton btnNainMenu;
	private JButton btnExit;
	private JButton btnDissapprove;///where is the implementation?
	private JButton btnLecturerReports;
	private JLabel lblChooseReport;	
	private JComboBox cmbBxLecturer;
	private JComboBox cmbBxstudent;
	private MainGUI mainGUI;
	
	public PrincipalReports(PrincipalController principalController) {
			super();
			initialize();
		}

	private void initialize() {
			setBorder(new TitledBorder(null, "principal  reports: ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
			setBackground(SystemColor.activeCaption);
			setBounds(0,0,MainGUI.setX,MainGUI.setY);
			setLayout(null);
	
			add(GETbtnExmReprots());			
			add(GETbtnStudentReports());
			add(GETbtnLecturerReports());
			add(GETlblChooseReport());			
			add(GETbtnNainMenu());
			add(GETbtnExit());
			add(GETcmbBxLecturer());
			add(GETcmbBxstudent());
			


		}
		
	private JLabel GETlblChooseReport()
	{
		if(lblChooseReport==null)
		{
			lblChooseReport = new JLabel("static report : ");
			lblChooseReport.setFont(new Font("David", Font.PLAIN, 14));
			lblChooseReport.setBounds(10, 21, 128, 23);
		}
		return lblChooseReport;
	}

	private JButton GETbtnNainMenu()
	{
		if(btnNainMenu==null)
			{
				btnNainMenu= new JButton("main menu");
				btnNainMenu.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
					}
				});
				btnNainMenu.setBounds(10, 442, 89, 23);
				btnNainMenu.addActionListener(this);
			}
		return btnNainMenu;
	}
/////?????????????????????????????????????????
			
	private JButton GETbtnExit()
	{
		if(btnExit==null)
		{
			btnExit= new JButton("exit");
			btnExit.setBounds(401, 445, 89, 23);
			btnExit.addActionListener(this);
		}
		return btnExit;
	}
			
			
			private JButton GETbtnLecturerReports()
			
			{
				if(btnLecturerReports==null)
				{
					btnLecturerReports = new JButton("lecturer reports");
					btnLecturerReports.setBounds(20, 55, 163, 23);
					btnLecturerReports.addActionListener(this);
				}
				return btnLecturerReports;
			}
			
			
			private JComboBox GETcmbBxLecturer()
			{
				if (cmbBxLecturer==null)
				{
					cmbBxLecturer = new JComboBox();
					cmbBxLecturer.setBounds(20, 108, 438, 23);
					cmbBxLecturer.addActionListener(this);
				}
				return cmbBxLecturer;
			}
				
				
			
			
			private JComboBox GETcmbBxstudent()
			{
				if(cmbBxstudent==null)
				{
					cmbBxstudent = new JComboBox();
					cmbBxstudent.setBounds(20, 321, 438, 23);		
					cmbBxstudent.addActionListener(this);
				}
				return cmbBxstudent;
			}


		private JButton GETbtnExmReprots()
		{
			if(btnExamRepots==null)
			{
				btnExamRepots = new JButton("exam repots");
				btnExamRepots.setBounds(20, 160, 163, 23);
				btnExamRepots.addActionListener(this);
		}
			return btnExamRepots;
		}
		
		private JButton GETbtnStudentReports() {
			if (btnStudentReports==null){

				btnStudentReports = new JButton("student reports");
				btnStudentReports.setBounds(120, 260, 163, 23);
				btnStudentReports.addActionListener(this);
			}
			return btnStudentReports;
		}




		@Override
		public void actionPerformed(ActionEvent e) {
			if(e.getSource() == btnStudentReports)
				MainGUI.handleprincipalGUI(1);//need to do: logout from the system 
			
			if(e.getSource() == btnExamRepots)
				MainGUI.handleprincipalGUI(2);//need to do: logout from the system 
			
			if(e.getSource() == btnNainMenu)
				MainGUI.handleprincipalGUI(3);//need to do: logout from the system 
			
			if(e.getSource() == btnExit)
				MainGUI.handleprincipalGUI(4);
			
			if(e.getSource() == btnLecturerReports)
				MainGUI.handleprincipalGUI(8);//need to do: logout from the system 
			
			if(e.getSource() == cmbBxLecturer)
				MainGUI.handleprincipalGUI(11);
			
			if(e.getSource() == cmbBxstudent)
				MainGUI.handleprincipalGUI(13);//need to do: logout from the system
	
		}	
}
